[[NSURL alloc] initFileURLWithPath:(NSString)] returns null
Posted
by Ajay Pandey
on Stack Overflow
See other posts from Stack Overflow
or by Ajay Pandey
Published on 2010-06-09T12:15:45Z
Indexed on
2010/06/09
12:22 UTC
Read the original article
Hit count: 324
cocoa
NSString *soundFilePath = [[NSBundle mainBundle] pathForResource:@"Opening" ofType:@"wav"];
NSURL *fileURL = [[NSURL alloc] initFileURLWithPath: soundFilePath];
NSLog(@"@ajay");
AVAudioPlayer *audioPlayer =
[[AVAudioPlayer alloc] initWithContentsOfURL:fileURL error:nil];
[fileURL release];
[audioPlayer play];
i have inserted a wav file in my project.But
NSURL *fileURL = [[NSURL alloc] initFileURLWithPath: soundFilePath];
returns NULL and console prints following:
and application KILLS... Can someone help me?
© Stack Overflow or respective owner